﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="FeedBack.aspx.cs" Inherits="user_FeedBack" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitle" runat="Server">
    <h1>
        <asp:Label runat="server" Text="<%$Resources:Menu,SendUsYourFeedback%>" ID="lblPageName"></asp:Label></h1>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label runat="server" Text="<%$Resources:General,LangOption%>" Visible="false"
        ID="lblLangOption" />
    <asp:HyperLink runat="server" Visible="false" ID="lnkNewCarUsage" NavigateUrl="#"
        Text="New"></asp:HyperLink>
    <div class="bc2">
        <asp:Label runat="server" ID="lblSiteLocation" Text="You are here : " CssClass="bclist" />
        <asp:SiteMapPath SiteMapProvider="SiteUserSiteMapProvider" ID="smpProvider" runat="server"
            PathSeparator=" : ">
            <PathSeparatorStyle CssClass="bcarrow" />
            <CurrentNodeStyle CssClass="bclist" />
            <NodeStyle CssClass="bclink" />
            <RootNodeStyle CssClass="bclink" />
        </asp:SiteMapPath>
        <div class="clear">
        </div>
    </div>
    <div class="toggle">
        <div class="title opened" id="opened1">
            <img src="../images/icons/dark/dialog.png" alt="" class="titleIcon" />
            <h6>
                <asp:Label ID="lblSendUsYourFeedback" runat="server" Text="<%$Resources:Menu,SendUsYourFeedback%>" />
            </h6>
        </div>
        <div class="form">
            <fieldset class="step">
                <div class="formRow">
                    <asp:ValidationSummary HeaderText="Opps..,please complete all(*) fields." runat="server"
                        ValidationGroup="feedback" ID="vsFeedback" ShowMessageBox="false" ShowSummary="true" />
                    <div style="display: none;">
                        <asp:TextBox ID="lblFeedBackTitle" runat="server" Text="<%$ Resources:Menu,Feedback%>"></asp:TextBox></div>
                </div>
                <div class="formRow">
                    <div>
                        <%=GetGlobalResourceObject("Menu", "Whatyoufeel")%>
                    </div>
                    <div class="formRight">
                        <table width="40%" cellpadding="2" cellspacing="2">
                            <tr>
                                <td style="width: 20%" align="center">
                                    <asp:ImageButton ID="ibtnVeryUseful" runat="server" ToolTip="<%$ Resources:Menu,VeryUseful%>"
                                        ImageUrl="../images/icon/emotion/happy-icon.png" Width="75" Height="75" BorderStyle="none"
                                        OnClientClick="return ChangeImage('EV')" />
                                </td>
                                <td style="width: 20%" align="center">
                                    <asp:ImageButton ID="ibtnGood" runat="server" ToolTip="<%$ Resources:Menu,Good%>"
                                        ImageUrl="../images/icon/emotion/smile-icon.png" Width="75" Height="75" BorderStyle="none"
                                        OnClientClick="return ChangeImage('EG')" />
                                </td>
                                <td style="width: 20%" align="center">
                                    <asp:ImageButton ID="ibtnOk" runat="server" ToolTip="<%$ Resources:Menu,OK%>" BorderStyle="none"
                                        ImageUrl="../images/icon/emotion/ok-icon.png" Width="75" Height="75" OnClientClick="return ChangeImage('EO')" />
                                </td>
                                <td style="width: 20%" align="center">
                                    <asp:ImageButton ID="ibtnSad" runat="server" ToolTip="<%$ Resources:Menu,Sad%>" ImageUrl="../images/icon/emotion/sad-icon.png"
                                        Width="75" Height="75" BorderStyle="none" OnClientClick="return ChangeImage('ES')" />
                                </td>
                                <td style="width: 20%" align="center">
                                    <asp:ImageButton ID="ibtnAngry" runat="server" ToolTip="<%$ Resources:Menu,Angry%>"
                                        ImageUrl="../images/icon/emotion/angry-icon.png" Width="75" Height="75" BorderStyle="none"
                                        OnClientClick="return ChangeImage('EA')" />
                                </td>
                            </tr>
                            <div style="display: none;">
                                <asp:TextBox ID="txtEmotionType" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvEmotionType" ValidationGroup="feedback" validationErrorCssClass="validationError"
                                    runat="server" ErrorMessage="<%$ Resources:Menu,WhatyoufeelMessage%>" ControlToValidate="txtEmotionType"></asp:RequiredFieldValidator>
                            </div>
                        </table>
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="formRow">
                    <div>
                        <%=GetGlobalResourceObject("Menu", "FeedbackType")%>
                    </div>
                    <div class="formRight">
                        <table width="50%" cellpadding="2" cellspacing="2">
                            <tr>
                                <td colspan="5">
                                    <asp:ImageButton ID="ibtnSuggestion" runat="server" ToolTip="<%$ Resources:Menu,Suggestion%>"
                                        ImageUrl="../images/icon/emotion/button_suggestion.png" BorderStyle="none" OnClientClick="return ChangeImage('BS')"
                                        Style="width: 114px; height: 27px;" />
                                    <asp:ImageButton ID="ibtnCompliment" runat="server" ToolTip="<%$ Resources:Menu,Compliment%>"
                                        ImageUrl="../images/icon/emotion/button_compliment.png" BorderStyle="none" OnClientClick="return ChangeImage('BC')"
                                        Style="width: 114px; height: 27px;" />
                                    <asp:ImageButton ID="ibtnBug" runat="server" ToolTip="<%$ Resources:Menu,Bug%>" ImageUrl="../images/icon/emotion/button_bug.png"
                                        BorderStyle="none" OnClientClick="return ChangeImage('BB')" Style="width: 114px;
                                        height: 27px;" />
                                </td>
                            </tr>
                            <div style="display: none;">
                                <asp:TextBox ID="txtFeedbackType" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvFeedbackType" ValidationGroup="feedback" validationErrorCssClass="validationError"
                                    runat="server" ErrorMessage="<%$ Resources:Menu,FeedbackTypeMessage%>" ControlToValidate="txtFeedbackType"></asp:RequiredFieldValidator>
                            </div>
                        </table>
                    </div>
                    <div style="display: none;">
                        <div class="formRow">
                            <asp:Label runat="server" ID="lblYourName" Text="<%$Resources:Menu,YourName%>" />
                            <div class="formRight">
                                <asp:TextBox ID="txtName" MaxLength="50" class="text" runat="server" Width="200px"></asp:TextBox>
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                        <div class="formRow">
                            <asp:Label runat="server" ID="lblEmail" Text="<%$Resources:Menu,YourEmail%>" />
                            <div class="formRight">
                                <asp:TextBox ID="txtEmail" Enabled="True" runat="server" Width="250px"></asp:TextBox>
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                    </div>
                    <div class="formRow">
                        <asp:Label runat="server" ID="lblYourFeedback" Text="<%$Resources:Menu,YourFeedback%>" />
                        <div class="formRight">
                                <span style="font-style:italic; color:Blue;">(Min 25, Max 1000 Char)</span><br />
                            <asp:TextBox ID="txtFeedBack" Width="350px" Enabled="true" runat="server" Columns="61"
                                MaxLength="500" Rows="4" TextMode="MultiLine"></asp:TextBox>
                            <asp:RequiredFieldValidator ValidationGroup="feedback" ID="rfvFeedback" runat="server"
                                ErrorMessage="" Text="*" ControlToValidate="txtFeedBack"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="revFeedback" runat="server" ControlToValidate="txtFeedBack"
                                        ValidationExpression="^([\u0000-\uDFFF']{25,1000})$|^([a-zA-Z''-'\s]{25,1000})$" ValidationGroup="feedback"
                                        ErrorMessage="" Text="*"></asp:RegularExpressionValidator>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="formRow" id="divThankYou" visible="false" runat="server">
                        <asp:Label runat="server" ID="lbl" Text=""></asp:Label>
                        <div class="formRight">
                            <asp:Label runat="server" Font-Size="Large" ForeColor="green" ID="lblThankYou"><%=GetGlobalResourceObject("Menu", "FeedbackThankyou")%></asp:Label>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="formRow">
                        <asp:Label runat="server" ID="Label1" Text="" />
                        <div class="formRight">
                            <asp:Button ID="btnSubmit" runat="server" CssClass="blueB ml10" OnClick="btnSubmit_Click"
                                Text="<%$Resources:General,Submit%>" ValidationGroup="feedback" />&nbsp;
                            <asp:Label ID="lblMessage" ForeColor="Red" runat="server"></asp:Label>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
            </fieldset>
        </div>
    </div>
    <script type="text/javascript">

        function showhide(el) {

            el = document.getElementById(el);
            el.style.display = (el.style.display == "none") ? "block" : "none";

        }
        function ChangeImage(btnName) {

            var txtET = document.getElementById('<%=txtEmotionType.ClientID%>');
            var txtFT = document.getElementById('<%=txtFeedbackType.ClientID%>');

            var imgBS = document.getElementById('<%=ibtnSuggestion.ClientID%>');
            var imgBC = document.getElementById('<%=ibtnCompliment.ClientID%>');
            var imgBB = document.getElementById('<%=ibtnBug.ClientID%>');

            var imgEV = document.getElementById('<%=ibtnVeryUseful.ClientID%>');
            var imgEG = document.getElementById('<%=ibtnGood.ClientID%>');
            var imgEO = document.getElementById('<%=ibtnOk.ClientID%>');
            var imgES = document.getElementById('<%=ibtnSad.ClientID%>');
            var imgEA = document.getElementById('<%=ibtnAngry.ClientID%>');

            if (btnName == "BS") {
                txtFT.value = "1";
                imgBS.src = '../images/icon/emotion/button_suggestion_s.png';
                imgBC.src = '../images/icon/emotion/button_compliment.png';
                imgBB.src = '../images/icon/emotion/button_bug.png';
            }
            else if (btnName == "BC") {
                txtFT.value = "2";
                imgBS.src = '../images/icon/emotion/button_suggestion.png';
                imgBC.src = '../images/icon/emotion/button_compliment_s.png';
                imgBB.src = '../images/icon/emotion/button_bug.png';
            }
            else if (btnName == "BB") {
                txtFT.value = "3";
                imgBS.src = '../images/icon/emotion/button_suggestion.png';
                imgBC.src = '../images/icon/emotion/button_compliment.png';
                imgBB.src = '../images/icon/emotion/button_bug_s.png';
            }
            else if (btnName == "EV") {
                txtET.value = "1";
                imgEV.src = '../images/icon/emotion/happy-icon_s.png';
                imgEG.src = '../images/icon/emotion/smile-icon.png';
                imgEO.src = '../images/icon/emotion/ok-icon.png';
                imgES.src = '../images/icon/emotion/sad-icon.png';
                imgEA.src = '../images/icon/emotion/angry-icon.png';
            }
            else if (btnName == "EG") {
                txtET.value = "2";
                imgEV.src = '../images/icon/emotion/happy-icon.png';
                imgEG.src = '../images/icon/emotion/smile-icon_s.png';
                imgEO.src = '../images/icon/emotion/ok-icon.png';
                imgES.src = '../images/icon/emotion/sad-icon.png';
                imgEA.src = '../images/icon/emotion/angry-icon.png';
            }
            else if (btnName == "EO") {
                txtET.value = "3";
                imgEV.src = '../images/icon/emotion/happy-icon.png';
                imgEG.src = '../images/icon/emotion/smile-icon.png';
                imgEO.src = '../images/icon/emotion/ok-icon_s.png';
                imgES.src = '../images/icon/emotion/sad-icon.png';
                imgEA.src = '../images/icon/emotion/angry-icon.png';
            }
            else if (btnName == "ES") {
                txtET.value = "4";
                imgEV.src = '../images/icon/emotion/happy-icon.png';
                imgEG.src = '../images/icon/emotion/smile-icon.png';
                imgEO.src = '../images/icon/emotion/ok-icon.png';
                imgES.src = '../images/icon/emotion/sad-icon_s.png';
                imgEA.src = '../images/icon/emotion/angry-icon.png';
            }
            else if (btnName == "EA") {
                txtET.value = "5";
                imgEV.src = '../images/icon/emotion/happy-icon.png';
                imgEG.src = '../images/icon/emotion/smile-icon.png';
                imgEO.src = '../images/icon/emotion/ok-icon.png';
                imgES.src = '../images/icon/emotion/sad-icon.png';
                imgEA.src = '../images/icon/emotion/angry-icon_s.png';
            }
            else {
                txtET.value = "";
                txtFT.value = "";

                imgBS.src = '../images/icon/emotion/button_suggestion.png';
                imgBC.src = '../images/icon/emotion/button_compliment.png';
                imgBB.src = '../images/icon/emotion/button_bug.png';

                imgEV.src = '../images/icon/emotion/happy-icon.png';
                imgEG.src = '../images/icon/emotion/smile-icon.png';
                imgEO.src = '../images/icon/emotion/ok-icon.png';
                imgES.src = '../images/icon/emotion/sad-icon.png';
                imgEA.src = '../images/icon/emotion/angry-icon.png';
            }
            return false;
        } 
    </script>
</asp:Content>
